package cn.com.cpic.insurance.rulecheck.core.expression;

import cn.com.cpic.insurance.rulecheck.core.Context;
import cn.com.cpic.insurance.rulecheck.core.exception.OperateException;

/**
 * 
 * 
 * @author 代波
 * @since 2011-8-14
 */
public final class LogicalNotExpression implements Expression<Boolean> {
	private static final long serialVersionUID = -1777971132706851724L;

	private final Expression<Boolean> exp;

	public LogicalNotExpression(Expression<Boolean> exp) {
		this.exp = exp;
	}

	public Boolean operate(Context context) throws OperateException {
		return !exp.operate(context);
	}
}
